import request from "@/utils/request";

// 查询充值模板列表
export function listRechargeTemplate(query) {
  return request({
    url: "/customer/rechargeTemplate/list",
    method: "get",
    params: query,
  });
}

// 查询充值模板详细
export function getRechargeTemplate(id) {
  return request({
    url: `/customer/rechargeTemplate/edit/${id}`,
    method: "get",
  });
}

// 新增充值模板
export function addRechargeTemplate(data) {
  return request({
    url: "/customer/rechargeTemplate/add",
    method: "post",
    data: data,
  });
}

// 修改充值模板
export function updateRechargeTemplate(data) {
  return request({
    url: "/customer/rechargeTemplate/edit",
    method: "put",
    data: data,
  });
}

// 删除充值模板
export function delRechargeTemplate(id) {
  return request({
    url: "/customer/rechargeTemplate/remove/" + id,
    method: "delete",
  });
}

// 修改充值模板状态
export function changeRechargeTemplateStatus(id, isEnable) {
  const data = {
    id,
    isEnable,
  };
  return request({
    url: "/customer/rechargeTemplate/changeStatus",
    method: "put",
    data: data,
  });
}
